<?php
session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="imagetoolbar" content="no" />
        <title>Bienvenue sur EXia Store</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script type="text/javascript" src="../Controleur/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
        <link rel="stylesheet" type="text/css" href="../Controleur/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
        <link rel ="stylesheet" href="Style.css" /> 
        <script src="../Helper/JQuery.js"></script>
        <script src="../Helper/Script.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {

                $("a.Detail").fancybox({
                    'titlePosition': 'inside',
                    'transitionIn': 'none',
                    'transitionOut': 'none'
                });

            });
        </script>


    </head>
    <header id="header">
        <table id="tableheader">
            <tr id="LigneCompte">
                <td id='MenuComptelog'>
                    <?php if (isset($_SESSION['Utilisateur'])) { ?>
                        <ul id ="ListeCompteLog">
                            <li id="BoutonListeTop"><a class ="Liens" href="Compte.php">Bonjour <?php echo $_SESSION['Utilisateur'][0]; ?></a></li>
                            <li id="BoutonListeTop"><a class="Liens" href="../Controleur/Authentification/logout.php"> [Se déconnecter]</a></li>
                        </ul>   
                        <?php
                    } else {
                        echo 'Vous n\'etes pas connecté';
                    }
                    ?></td>
                <td id="MenuCompte" >
                    <ul id ="ListeCompte">
                        <li id="BoutonListeTop"><a href ="Compte.php" class="Liens">Mon compte</a></li>
                        <li id="BoutonListeTop" ><a href ="MonPanier.php" class="Liens">Mon panier</a></li>
                        <li id="BoutonListeTop" ><a href ="Compte.php" class="Liens">Ma commande</a></li>
                        <li id="BoutonListeTop" ><a href ="Compte.php" class="Liens">Support</a></li>
                    </ul>
                </td>
            </tr>
            <tr id="BanniereSearch">
                <td>
                    <img id="banniere" src="Images/Exiastore2013.png">
                </td>

                <td id ="Recherche">
                    <form name="Recherche" method="POST" action="../Controleur/Recherche/rechercher.php">
                        <input type="text" name="description" >
                        <input type="submit" name="Rechercher" value="Rechercher">
                    </form>
                </td>
            </tr>
            <tr id="MenuAccueil">
                <td colspan ="2">
                    <ul id ="ListeAccueil">
                        <li id="BoutonListeBot"><a href ="../index.php" class="Liens">Accueil</a></li>
                        <li id="BoutonListeBot">CD</li>
                        <li id="BoutonListeBot">DVD</li>
                        <li id="BoutonListeBot">Livraison</li>
                        <li id="BoutonListeBot">Promotion</li>
                    </ul>
                </td>

            </tr>
        </table>
    </header>
    <body>
        <table id="Corps">
            <tr>
                <td id="TabArticle">
                    <nav id="MenuLeft">
                        <h1 id ="EnTeteMenuLeft">CD</h1>
                        <ul id ="ListeLeft">
                            <li>Rock</li>
                            <li>Rap</li>
                            <li>Electro</li>
                            <li>Classique</li>
                            <li>Autre</li>
                        </ul>
                    </nav>
                    <nav id="MenuLeft">
                        <h1 id ="EnTeteMenuLeft">DVD</h1>
                        <ul id ="ListeLeft">
                            <li>Action</li>
                            <li>Humour</li>
                            <li>Fantastique</li>
                            <li>Autre</li>
                        </ul>
                    </nav>
                </td>
                <td>
                    <?php
                    foreach ($_SESSION['res'] AS $VALUE) {
                        ?>

                        <fieldset id="FieldsetResultat">
                            <legend id="TitreResultat"><?php echo $VALUE['TITRE']; ?></legend>
                            <table id="TableauResultat">
                                <tr>
                                    <td>
                                        <img src="Images/<?php echo $VALUE['IMAGE']; ?>" >
                                    </td>
                                    <td>       
                                        <ul>
                                            <li>Description : <?php echo $VALUE['DESCRIPTION']; ?></li>
                                            <li>Stock : <?php echo $VALUE['STOCK']; ?></li>
                                            <li>Prix : <?php echo $VALUE['PRIX_UNITAIRE']; ?> €</li>
                                        </ul>

                                    </td>
                                </tr>
                                <tr >
                                    <td colspan="2"     >
                                        <input type="button" value="Ajouter au panier" onclick ="ajouter(<?php echo $VALUE['ID_ARTICLE']; ?>);">
                                        <a class="Detail" href="#<?php echo $VALUE['ID_ARTICLE'] ?>" title="Détail de l'article"><input type="button" value="Detail"></a>
                                    </td>
                                </tr>

                            </table>
                        </fieldset>
                        <div>

                            <div style="display: none;">


                                <div id="<?php echo $VALUE['ID_ARTICLE'] ?>" style="width:auto;height:auto;overflow:auto;display: inline;">
                                    <legend id="TitreResultat"><?php echo $VALUE['TITRE']; ?></legend>
                                    <table>
                                        <tr>
                                            <td>
                                                <img src="Images/<?php echo $VALUE['IMAGE']; ?>" >
                                            </td>
                                            <td>
                                                <ul
                                                    <br>
                                                    <li>Auteur : <?php echo $VALUE['AUTEUR']; ?></li>
                                                    <li>Editeur : <?php echo $VALUE['EDITEUR']; ?></li>
                                                    <li>Description : <?php echo $VALUE['DESCRIPTION']; ?></li>
                                                    <li>Date d'édition : <?php echo $VALUE['DATE_EDIITION']; ?></li>
                                                    <li>Stock : <?php echo $VALUE['STOCK']; ?></li>
                                                    <li>Prix : <?php echo $VALUE['PRIX_UNITAIRE']; ?> €</li>
                                                </ul>
                                            </td>
                                        </tr>
                                    </table>


                                </div>
                            </div>

                        </div>
<?php } ?>
                </td>
            </tr>
        </table>
    </body>
    <footer id="Footer">
        <table id="TableFooter">
            <tr>
                <td>

                </td>
            </tr>
        </table>
    </footer>
</html>
